<template>
<div class="container"  style="text-align: left;">

  <ul class="nav nav-tabs">
    <li role="presentation" class="active">我的问诊</li>
  </ul>
  <div class="list-group" v-for="order in refused_orders" @click="toDetail(order.id)" v-if="isShow">
      <h6 class="list-group-item text-right text-success">
        <div v-if="order.status==='0'">
          未回复
        </div>
        <div v-else-if="order.status==='1'">
          已回复
        </div>
      </h6>
      <p class="list-group-item">{{order.symptom}}</p>
      <p class="list-group-item"><small>提问时间：{{order.times}}</small></p>
  </div>
  <div class="img_message" v-if="!isShow">
    <img src="../assets/img1.png">
  </div>
</div>
</template>

<script>
  export default {
    name: 'MyOrder',
    data(){
      return {
        refused_orders: [],
        isShow: true,
      }
    },
    methods:{
      getPost: function () {
        var Opid =localStorage.getItem('Opid');
        console.log(Opid);
        this.$ajax.get('http://47.75.110.31:8080/orinfo/findByOpid?opid='+Opid)
          .then(response => {
            this.refused_orders = response.data
            console.log(this.refused_orders)
          }).catch(function (err) {
          console.log(err)
        })
      },
      toDetail (orderId) {
        this.$router.push('/OrderDetail?order_id=' + orderId);

      }
    },
    mounted () {
      this.getPost();
    }
  }
</script>

<style scoped>
  .img_message {
    display: flex;
    justify-content: center;
    align-items: center;
  }
</style>
